<script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/ueditor/ueditor.all.min.js"></script>
<!-- 编辑器公式插件 -->
<script type="text/javascript" charset="utf-8" src="/ueditor/kityformula-plugin/addKityFormulaDialog.js"></script>
<script type="text/javascript" charset="utf-8" src="/ueditor/kityformula-plugin/getKfContent.js"></script>
<script type="text/javascript" charset="utf-8" src="/ueditor/kityformula-plugin/defaultFilterFix.js"></script>
<div class="span10" id="datacontent">

    <ul class="breadcrumb">
        <li><a href="/exercise/index/index"></a> 剑雅真题<span class="divider">/</span></li>
        <li><a href="/exercise/banner/index">真题banner</a> <span class="divider">/</span></li>
        <li class="active">修改</li>
    </ul>
    <form action="/exercise/banner/update" method="post" class="form-horizontal">
        <fieldset>
            <div class="control-group">
                <label for="area" class="control-label">名称：</label>
                <div class="controls">
                    <input type="text" value="<?php echo $data?$data->name:''?>" name="name">
                </div>
            </div>
            <div class="control-group">
                <label for="area" class="control-label">typeid：</label>
                <div class="controls">
                    <input type="text" value="<?php echo $data?$data->typeid:''?>" name="typeid">
                </div>
            </div>
            <div class="control-group">
                <label for="area" class="control-label">图片1：</label>
                <div class="controls">
                    <input type="text" value="<?php echo $data?$data->image1:''?>" class="image1" name="image1">
                    <a href="#" class="btn btn-info" onclick="upImage()">上传文件</a>
                </div>
            </div>
            <div class="control-group">
                <label for="area" class="control-label">图片1跳转：</label>
                <div class="controls">
                    <input type="text" value="<?php echo $data?$data->image_url1:''?>" class="image_url1" name="image_url1">
                </div>
            </div>
            <div class="control-group">
                <label for="area" class="control-label">图片2：</label>
                <div class="controls">
                    <input type="text" value="<?php echo $data?$data->image2:''?>" class="image2" name="image2">
                    <a href="#" class="btn btn-info" onclick="upImage2()">上传文件</a>
                </div>
            </div>
            <div class="control-group">
                <label for="area" class="control-label">图片2跳转：</label>
                <div class="controls">
                    <input type="text" value="<?php echo $data?$data->image_url2:''?>" class="image_url2" name="image_url2">
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <button class="btn btn-primary" type="submit">提交</button>
                    <input type="hidden" name="id" value="<?php echo $data?$data->id:''?>"/>
                </div>
            </div>
        </fieldset>
    </form>
</div>

<script type="text/javascript">
    //实例化编辑器
    var o_ueditorupload = UE.getEditor('j_ueditorupload',
        {
            autoHeightEnabled:false
        });
    o_ueditorupload.ready(function ()
    {

        o_ueditorupload.hide();//隐藏编辑器

        //监听图片上传
        o_ueditorupload.addListener('beforeInsertImage', function (t,arg)
        {
            $('.image1').val(arg[0].src);

        });

        /* 文件上传监听
         * 需要在ueditor.all.min.js文件中找到
         * d.execCommand("insertHtml",l)
         * 之后插入d.fireEvent('afterUpfile',b)
         */
        o_ueditorupload.addListener('afterUpfile', function (t, arg)
        {

        });
    });

    //弹出图片上传的对话框
    function upImage()
    {
        var myImage = o_ueditorupload.getDialog("insertimage");
        myImage.open();
    }

    //实例化编辑器
    var o_ueditorupload2 = UE.getEditor('j_ueditorupload2',
        {
            autoHeightEnabled:false
        });
    o_ueditorupload2.ready(function ()
    {

        o_ueditorupload2.hide();//隐藏编辑器

        //监听图片上传
        o_ueditorupload2.addListener('beforeInsertImage', function (t,arg)
        {
            $('.image2').val(arg[0].src);

        });

        /* 文件上传监听
         * 需要在ueditor.all.min.js文件中找到
         * d.execCommand("insertHtml",l)
         * 之后插入d.fireEvent('afterUpfile',b)
         */
        o_ueditorupload2.addListener('afterUpfile', function (t, arg)
        {

        });
    });
    //弹出图片上传的对话框
    function upImage2()
    {
        var myImage2 = o_ueditorupload2.getDialog("insertimage");
        myImage2.open();
    }
</script>
<script type="text/plain" id="j_ueditorupload"></script>
<script type="text/plain" id="j_ueditorupload2"></script>
